<?php

namespace Admin\Model;
use Think\Model;

class UserModel extends Model {
    protected $_validate = array(
        array('user', '/([\x{4e00}-\x{9fa5}])|[a-zA-Z]/u', '只能使用中英文', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
        array('email', 'email', '邮箱格式不正确', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
        array('pwd', 'require', '密码不能为空', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
        array('tall', '/0?(13|14|15|18)[0-9]{9}/', '电话格式不正确', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
    );

    protected $_auto = array(
        array('ctime', NOW_TIME, self::MODEL_INSERT),
        array('pwd', 'md5', self::MODEL_BOTH,'function'),
        array('status', '1', self::MODEL_BOTH),
    );
}